package com.yami.shop.webservice.platform.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yami.shop.bean.model.TransferTokenRecord;
import com.yami.shop.common.response.ServerResponseEntity;
import com.yami.shop.common.util.PageParam;
import com.yami.shop.webservice.common.service.TransferTokenRecordService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wxf
 * @date 2023/7/12 14:15
 */
@RestController
@RequestMapping( "/admin/transferRecord")
public class TransferTokenRecordController {

    @Autowired
    private TransferTokenRecordService transferRecordService;

    @GetMapping("/page")
    @Operation(summary = "分页获取划转记录")
    public ServerResponseEntity<IPage<TransferTokenRecord>> page(PageParam<TransferTokenRecord> page, TransferTokenRecord param) {
        IPage<TransferTokenRecord> pageBox = transferRecordService.getPage(page, param);
        return ServerResponseEntity.success(pageBox);
    }

    @GetMapping("/collectPage")
    @Operation(summary = "分页查询划转汇总数据")
    public ServerResponseEntity<IPage<TransferTokenRecord>> collectPage(PageParam<TransferTokenRecord> page, TransferTokenRecord param) {
        IPage<TransferTokenRecord> pageBox = transferRecordService.getCollectPage(page, param);
        return ServerResponseEntity.success(pageBox);
    }
}
